<template>
  <div class="block">
    <el-carousel :interval="3000" >
      <el-carousel-item v-for="(item,index) in bannerdata" :key="index" >
        <h3>
          <img :src="bannerdata[index]">
        </h3>
      </el-carousel-item>
    </el-carousel>
  </div>

</template>

<script>
import { reactive, toRefs } from 'vue'

export default {
     props: {
        bannerdata: {
            type: Array,
            default(){
                return[]
            }
        }
    },
  setup () {
    const state = reactive({
      imgArray: []
    })

    return {
      ...toRefs(state)
    }
  }
}
</script>

<style scoped>
 .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }
.el-carousel{
  width: 100%;
  height: 200px;
  margin-top: 45px;
}
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>